import { currentUserID } from "@/utils/common.js";
import { utils } from 'hi-ui';
export default {
    id: "HumitureEntity",
    returnTotal:true,
    modelFile: "humiture/dataset/HumitureEntity.xml",
    sortFields: [
        "FID",
        "FRECORDPERSON",
        "FDATE",
        "FTIME",
        "FMONITOR",
        "FEQUIPMENTDESC",
        "FEQUIPMENTID",
        "FTEMPERATURE",
        "FHUMIDITY",
        "FADJUST",
        "FADJUSTTEMPERATURE",
        "FADJUSTHUMIDITY",
        "FENTERPRISEDESC",
        "FENTERPRISEID",
        "FSHOPDESC",
        "FSHOPDESCID",
        "FUSERDESC",
        "FUSERID",
        "FCREATEDATE",

    ],
    fields: {
        FID: {
            name: "FID", //字段ID
            label: "ID", //字段描述
            dbtype: "dbString", //数据类型
            default: {
                //默认值
                //rule: 'first', //prior   填充规则
                exps: (data) => {
                    //填充表达式
                    return utils.string.guid();
                },
            },
        },
        FRECORDPERSON: {
            name: "FRECORDPERSON", //字段ID
            label: "记录人", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
            required: true,

        },

        FDATE: {
            name: "FDATE", //字段ID
            label: "日期", //字段描述
            dbtype: "dbDate", //数据类型
            required: true,
            readonly: true,
            length: 25,
            default: {
                //默认值
                exps: (data) => {
                    //填充表达式
                    return utils.date.format(new Date(), "yyyy-MM-dd HH:mm:ss");
                },
            },

        },
        FTIME: {
            name: "FTIME", //字段ID
            label: "时段", //字段描述
            dbtype: "dbDate", //数据类型
            required: true,

        },
        FMONITOR: {
            name: "FMONITOR", //字段ID
            label: "监控区域", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
            required: true,
        },
        FEQUIPMENTDESC: {
            name: "FEQUIPMENTDESC", //字段ID
            label: "设备名称", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },
        FEQUIPMENTID: {
            name: "FEQUIPMENTID", //字段ID
            label: "设备编号", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },
        FTEMPERATURE: {
            name: "FTEMPERATURE", //字段ID
            label: "温度(℃)", //字段描述
            dbtype: "dbFloat", //数据类型
            required: true,
        },
        FHUMIDITY: {
            name: "FHUMIDITY", //字段ID
            label: "湿度(%)", //字段描述
            dbtype: "dbFloat", //数据类型
            required: true,
        },
        FADJUST: {
            name: "FADJUST", //字段ID
            label: "调控措施", //字段描述
            dbtype: "dbString", //数据类型
            length: 50,
            required: true,
        },
        FADJUSTTEMPERATURE: {
            name: "FADJUSTTEMPERATURE", //字段ID
            label: "调控后温度(℃)", //字段描述
            dbtype: "dbFloat", //数据类型
            required: true,
        },
        FADJUSTHUMIDITY: {
            name: "FADJUSTHUMIDITY", //字段ID
            label: "调控后湿度(%)", //字段描述
            dbtype: "dbFloat", //数据类型
            required: true,
        },

        FSHOPDESC: {
            name: "FSHOPDESC", //字段ID
            label: "店铺", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },
        FSHOPDESCID: {
            name: "FSHOPDESCID", //字段ID
            label: "店铺编号", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },
        FENTERPRISEDESC: {
            name: "FENTERPRISEDESC", //字段ID
            label: "企业名称", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },
        FENTERPRISEID: {
            name: "FENTERPRISEID", //字段ID
            label: "企业ID", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,
        },
        FUSERDESC: {
            name: "FUSERDESC", //字段ID
            label: "用户", //字段描述
            dbtype: "dbString", //数据类型
            length: 25,

        },
        FUSERID: {
            name: "FUSERID", //字段ID
            label: "创建人", //字段描述
            dbtype: "dbString", //数据类型
            required: true,
            readonly: true,
            length: 25,
            default: {
                //默认值
                exps: (data) => {
                    //填充表达式
                    return currentUserID();
                },
            },
        },
        FCREATEDATE: {
            name: "FCREATEDATE", //字段ID
            label: "创建时间", //字段描述
            dbtype: "dbDate", //数据类型
            required: true,
            readonly: true,
            default: {
                //默认值
                exps: (data) => {
                    //填充表达式
                    return utils.date.format(new Date(), "yyyy-MM-dd HH:mm:ss");
                },
            },
        },
    }
}
